﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Microsoft.Practices.CompositeUI.Configuration;
using Microsoft.Practices.CompositeUI.Services;

namespace WPFCABShell.$safeprojectname$.Services.Module
{
	/// <summary>
	/// Defines the interface for a whitelist enumerator, which is a special <see cref="IModuleEnumerator"/>
	/// that uses a whitelist to determine whether a module should be loaded.
	/// </summary>
	public interface IWhitelistModuleEnumerator : IModuleEnumerator
	{
		/// <summary>
		/// Gets information about all modules regardless of whether they have been whitelisted.
		/// </summary>
		IEnumerable<IModuleInfo> AllModules
		{
			get;
		}

		/// <summary>
		/// Gets the trust status for a specified module.
		/// </summary>
		/// <param name="module">
		/// The module whose trust status is to be retrieved.
		/// </param>
		/// <returns>
		/// A member of <see cref="ModuleTrustStatus"/> indicating the trust status of the module.
		/// </returns>
		ModuleTrustStatus GetModuleTrustStatus(IModuleInfo module);

		/// <summary>
		/// Gets the status of a specified module.
		/// </summary>
		/// <param name="moduleInfo">
		/// The module whose status is to be determined.
		/// </param>
		/// <returns>
		/// A member of <see cref="ModuleStatus"/> indicating the status of the module.
		/// </returns>
		ModuleStatus GetStatus(IModuleInfo moduleInfo);

		/// <summary>
		/// Adds the specified module to the whitelist.
		/// </summary>
		/// <param name="moduleInfo">
		/// The module to be added.
		/// </param>
		void AddToWhitelist(IModuleInfo moduleInfo);

		/// <summary>
		/// Removes the specified module from the whitelist.
		/// </summary>
		/// <param name="moduleInfo">
		/// The module to be removed.
		/// </param>
		void RemoveFromWhitelist(IModuleInfo moduleInfo);

		/// <summary>
		/// Gets the <see cref="Assembly"/> for a given module.
		/// </summary>
		/// <param name="moduleInfo">
		/// The module whose corresponding <see cref="Assembly"/> is to be retrieved.
		/// </param>
		/// <returns>
		/// The <see cref="Assembly"/> instance corresponding to the module, or <see langword="null"/>.
		/// </returns>
		Assembly GetAssemblyForModule(IModuleInfo moduleInfo);
	}
}
